#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections.Generic;
using System.Text;

namespace Osh.Teletext
{
	public class PacketM294 : EnhancementDataPacket
	{
		private PageFunction _pageFunction;
		private PageCoding _pageCoding;
		private BasicLevel1TeletextCoding _basicLevel1TeletextCoding;

		public PacketM294(int magazine, int packet, byte[] data, int position)
			: base(magazine, packet, data, position)
		{
			int triplet1 = this.GetTriplet(0);
			_pageFunction = (PageFunction)(triplet1 & 0xF);
			_pageCoding = (PageCoding)((triplet1 >> 4) & 7);

			if(_pageFunction == PageFunction.BasicLevel1Teletext)
				_basicLevel1TeletextCoding = new BasicLevel1TeletextCoding(this);
		}

		public PageFunction PageFunction
		{
			get { return _pageFunction; }
		}

		public PageCoding PageCoding
		{
			get { return _pageCoding; }
		}

		public BasicLevel1TeletextCoding BasicLevel1TeletextCoding
		{
			get { return _basicLevel1TeletextCoding; }
		}
	}
}
